package com.shadow.baiqun.delegate.receive.partcheck;

import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import com.shadow.ui.recycler.ObjConverter;

/**
 * @author zy
 * on 2018/7/15
 */
public class MatchDataConverter {
    public PartCheckEntity convert(String response) {
        try {
            final JSONObject jsonObject = JSONObject.parseObject(response);
            if (jsonObject.getInteger("status") == 1) {
                String object = jsonObject.getString("reslut");
                return new ObjConverter<PartCheckEntity>().
                        convert(object, new TypeReference<PartCheckEntity>() {
                        });
            }
            return null;
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }
}
